import { AxiosPromise } from "axios";
import { rewardList, parameter } from "./type";
import service from "@/utils/request";
const { systemService } = service;

export function getRewardList(data: parameter): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/list",
    method: "post",
    data: data,
  });
}

export function updateReward(data: rewardList): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/updateReward",
    method: "patch",
    data: data,
  });
}

export function getReward(data: number): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/get/" + data,
    method: "get",
  });
}

export function addReward(data: rewardList): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/addReward",
    method: "post",
    data: data,
  });
}

export function deleteReward(data: number): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/delete/" + data,
    method: "get",
  });
}

export function getRewardType(): AxiosPromise<any> {
  return systemService({
    url: "/system/reward/getTypes",
    method: "get",
  });
}
export function enableReward(id: number): AxiosPromise<any> {
	return systemService({
		url: "/system/reward/enable/"+id,
		method: "get",
	});
}
